Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetch ec2 tags from aws instead of from facter command #1447

Closed
wants to merge 7 commits into from

Conversation

liyaqin1
Copy link
Contributor

@liyaqin1 liyaqin1 commented Feb 6, 2024

If a user adds tags through the AWS console, the previous method wouldn't be able to fetch these tags using the 'facter' command.

@liyaqin1 liyaqin1 requested a review from a team as a code owner February 6, 2024 22:52
@github-actions github-actions bot added the deploy-agent Includes changes to deploy-agent label Feb 6, 2024
deploy-agent/setup.py Outdated Show resolved Hide resolved
deploy-agent/setup.py Outdated Show resolved Hide resolved
@liyaqin1
Copy link
Contributor Author

liyaqin1 commented Feb 7, 2024

Tested on a test host with this latest 1.2.58 version. Got the correct tags on AWS console side:
I0207 00:26:32.410.477876663208 MainThread /root/.pex/installed_wheels/502183de0cb11c911983d26ffd0f8af0f0f55ad06ae3d2f4e9c2ce7f94dfa18a/deploy_agent-1.2.58-py3-none-any.whl/deployd/client/client.py:204] Host information is loaded. Host name: helloworlddummyservice-server-test-osoriano-integ-0a01d5a4, IP: 10.1.213.164, host id: i-07a2bddf23a2706af, agent_version=1.2.46-pinterest-1.0.2, autoscaling_group: helloworlddummyservice-server-test-osoriano-integ, availability_zone: us-east-1e, ec2_tags: {"aws:ec2launchtemplate:id": "lt-0e2fc39c66fc4c8a9", "Name": "helloworlddummyservice-server-test-osoriano-integ-0a01d5a4", "aws:autoscaling:groupName": "helloworlddummyservice-server-test-osoriano-integ", "usage_tag": "SRE", "aws:ec2launchtemplate:version": "2", "Autoscaling": "helloworlddummyservice-server-test-osoriano-integ", "service_mapping": "helloworlddummyservice-server-test-osoriano", "testTags": "yaqinli", "availability_zone": "us-east-1e"}, stage_type: None, group: ['CMP', 'helloworlddummyservice-server-test-osoriano-integ', 'envoy-sidecar', 'singer-prod-sidecar', 'tcollector-prod-sidecar', 'mcrouter-prod-sidecar', 'metrics-agent-prod-sidecar', 'zk_update_monitor-prod-sidecar'], account id: 998131032990

Screenshot 2024-02-06 at 4 30 30 PM

We can see the constraint is setup correctly here:
Screenshot 2024-02-06 at 4 31 36 PM

We can confirm that the tag originated from the deployd on the host and not from a CMDB query. This is because the CMDB has not been updated with the new tag yet, given that I had only added it a few minutes ago:
Screenshot 2024-02-06 at 4 27 30 PM

Further evidence for this can be found in the following log record:
Screenshot 2024-02-06 at 4 34 57 PM

@liyaqin1
Copy link
Contributor Author

liyaqin1 commented Feb 7, 2024

I have decided to discard this Pull Request as the 'facter' command does actually retrieve all tags. It's just that the delay seems a bit lengthy because it attempts to gather information every hour.

@liyaqin1 liyaqin1 closed this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-agent Includes changes to deploy-agent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants